﻿using System;
using System.Collections;
using System.IO;
using System.Web.UI;

namespace NWebMock
{
    public interface IHttpBrowserCapabilities
    {
        #region Properties

        /// <summary>
        /// Gets a value indicating whether the browser supports ActiveX controls.
        /// </summary>
        bool ActiveXControls { get; }

        /// <summary>
        /// Gets a value indicating whether the client is an America Online (AOL) browser.
        /// </summary>
        bool AOL { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports playing background sounds using the <bgsounds> HTML element.
        /// </summary>
        bool BackgroundSounds { get; }

        /// <summary>
        /// Gets a value indicating whether the browser is a beta version.
        /// </summary>
        bool Beta { get; }

        /// <summary>
        /// Gets the browser string (if any) that was sent by the browser in the User-Agent request header.
        /// </summary>
        string Browser { get; }

        /// <summary>
        /// Gets an ArrayList of the browsers in the Capabilities dictionary.
        /// </summary>
        ArrayList Browsers { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports decks that contain multiple forms, such as separate cards.
        /// </summary>
        bool CanCombineFormsInDeck { get; }

        /// <summary>
        /// Gets a value indicating whether the browser device is capable of initiating a voice call.
        /// </summary>
        bool CanInitiateVoiceCall { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports page content following WML <select> or <input> elements.
        /// </summary>
        bool CanRenderAfterInputOrSelectElement { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports empty HTML <select> elements.
        /// </summary>
        bool CanRenderEmptySelects { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports WML INPUT and SELECT elements together on the same card.
        /// </summary>
        bool CanRenderInputAndSelectElementsTogether { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports WML <option> elements that specify both onpick and value attributes.
        /// </summary>
        bool CanRenderMixedSelects { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports WML <onevent> and <prev> elements that coexist within the same WML card.
        /// </summary>
        bool CanRenderOneventAndPrevElementsTogether { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports WML cards for postback.
        /// </summary>
        bool CanRenderPostBackCards { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports WML <setvar> elements with a value attribute of 0.
        /// </summary>
        bool CanRenderSetvarZeroWithMultiSelectionList { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports sending e-mail by using the HTML <mailto> element for displaying electronic addresses.
        /// </summary>
        bool CanSendMail { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports Channel Definition Format (CDF) for webcasting.
        /// </summary>
        bool CDF { get; }

        /// <summary>
        /// Gets the version of the .NET Framework that is installed on the client.
        /// </summary>
        Version ClrVersion { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports cookies.
        /// </summary>
        bool Cookies { get; }

        /// <summary>
        /// Gets a value indicating whether the browser is a search engine Web crawler.
        /// </summary>
        bool Crawler { get; }

        /// <summary>
        /// Returns the maximum number of Submit buttons that are allowed for a form.
        /// </summary>
        int DefaultSubmitButtonLimit { get; }

        /// <summary>
        /// Gets the version number of ECMAScript that the browser supports.
        /// </summary>
        Version EcmaScriptVersion { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports HTML frames.
        /// </summary>
        bool Frames { get; }

        /// <summary>
        /// Gets the major version number of the wireless gateway used to access the server, if known. 
        /// </summary>
        int GatewayMajorVersion { get; }

        /// <summary>
        /// Gets the minor version number of the wireless gateway used to access the server, if known. 
        /// </summary>
        double GatewayMinorVersion { get; }

        /// <summary>
        /// Gets the version of the wireless gateway used to access the server, if known.
        /// </summary>
        string GatewayVersion { get; }

        /// <summary>
        /// Gets a value indicating whether the browser has a dedicated Back button.
        /// </summary>
        bool HasBackButton { get; }

        /// <summary>
        /// Gets a value indicating whether the scrollbar of an HTML <select multiple> element with an align attribute value of right is obscured upon rendering.
        /// </summary>
        bool HidesRightAlignedMultiselectScrollbars { get; }

        /// <summary>
        /// Gets or sets the fully qualified class name of the HtmlTextWriter to use.
        /// </summary>
        string HtmlTextWriter { get; set; }

        /// <summary>
        /// Gets the internal identifier of the browser as specified in the browser definition file.
        /// </summary>
        string Id { get; }

        /// <summary>
        /// Returns the type of input supported by browser.
        /// </summary>
        string InputType { get; }

        /// <summary>
        /// Gets a value indicating whether the browser has a color display.
        /// </summary>
        bool IsColor { get; }

        /// <summary>
        /// Gets a value indicating whether the browser is a recognized mobile device.
        /// </summary>
        bool IsMobileDevice { get; }

        /// <summary>
        /// Gets the value of the specified browser capability. In C#, this property is the indexer for the class.
        /// </summary>
        /// <param name="key">The name of the browser capability to retrieve.</param>
        /// <returns>The browser capability with the specified key name.</returns>
        string this[string key] { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports Java.
        /// </summary>
        bool JavaApplets { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports JavaScript.
        /// </summary>
        bool JavaScript { get; }

        /// <summary>
        /// Gets the Jscript version that the browser supports.
        /// </summary>
        Version JScriptVersion { get; }

        /// <summary>
        /// Gets the major (integer) version number of the browser.
        /// </summary>
        int MajorVersion { get; }

        /// <summary>
        /// Gets the maximum length in characters for the href attribute of an HTML <a> (anchor) element.
        /// </summary>
        int MaximumHrefLength { get; }

        /// <summary>
        /// Gets the maximum length of the page, in bytes, which the browser can display. 
        /// </summary>
        int MaximumRenderedPageSize { get; }

        /// <summary>
        /// Returns the maximum length of the text that a soft-key label can display.
        /// </summary>
        int MaximumSoftkeyLabelLength { get; }

        /// <summary>
        /// Gets the minor (that is, decimal) version number of the browser.
        /// </summary>
        double MinorVersion { get; }

        /// <summary>
        /// Gets the minor (decimal) version number of the browser as a string.
        /// </summary>
        string MinorVersionString { get; }

        /// <summary>
        /// Returns the name of the manufacturer of a mobile device, if known.
        /// </summary>
        string MobileDeviceManufacturer { get; }

        /// <summary>
        /// Gets the model name of a mobile device, if known.
        /// </summary>
        string MobileDeviceModel { get; }

        /// <summary>
        /// Gets the version of Microsoft HTML (MSHTML) Document Object Model (DOM) that the browser supports.
        /// </summary>
        Version MSDomVersion { get; }

        /// <summary>
        /// Returns the number of soft keys on a mobile device.
        /// </summary>
        int NumberOfSoftkeys { get; }

        /// <summary>
        /// Gets the name of the platform that the client uses, if it is known.
        /// </summary>
        string Platform { get; }

        /// <summary>
        /// Returns the MIME type of the type of image content typically preferred by the browser.
        /// </summary>
        string PreferredImageMime { get; }

        /// <summary>
        /// Returns the MIME type of the type of content typically preferred by the browser.
        /// </summary>
        string PreferredRenderingMime { get; }

        /// <summary>
        /// Gets the general name for the type of content that the browser prefers.
        /// </summary>
        string PreferredRenderingType { get; }

        /// <summary>
        /// Gets the request encoding preferred by the browser.
        /// </summary>
        string PreferredRequestEncoding { get; }

        /// <summary>
        /// Gets the response encoding preferred by the browser.
        /// </summary>
        string PreferredResponseEncoding { get; }

        /// <summary>
        /// Gets a value indicating whether the browser renders a line break before <select> or <input> elements.
        /// </summary>
        bool RendersBreakBeforeWmlSelectAndInput { get; }

        /// <summary>
        /// Gets a value indicating whether the browser renders a line break after list-item elements.
        /// </summary>
        bool RendersBreaksAfterHtmlLists { get; }

        /// <summary>
        /// Gets a value indicating whether the browser renders a line break after a stand-alone HTML <a> (anchor) element.
        /// </summary>
        bool RendersBreaksAfterWmlAnchor { get; }

        /// <summary>
        /// Gets a value indicating whether the browser renders a line break after an HTML <input> element.
        /// </summary>
        bool RendersBreaksAfterWmlInput { get; }

        /// <summary>
        /// Gets a value indicating whether the mobile-device browser renders a WML do-based form accept construct as an inline button rather than as a soft key.
        /// </summary>
        bool RendersWmlDoAcceptsInline { get; }

        /// <summary>
        /// Gets a value indicating whether the browser renders WML <select> elements as menu cards, rather than as a combo box.
        /// </summary>
        bool RendersWmlSelectsAsMenuCards { get; }

        /// <summary>
        /// Gets a value indicating whether the browser requires colons in element attribute values to be substituted with a different character.
        /// </summary>
        bool RequiresAttributeColonSubstitution { get; }

        /// <summary>
        /// Gets a value indicating whether the browser requires an HTML <meta> element for which the content-type attribute is specified.
        /// </summary>
        bool RequiresContentTypeMetaTag { get; }

        /// <summary>
        /// Gets a value indicating whether the browser requires control state to be maintained in sessions.
        /// </summary>
        bool RequiresControlStateInSession { get; }

        /// <summary>
        /// Gets a value indicating whether the browser requires a double-byte character set.
        /// </summary>
        bool RequiresDBCSCharacter { get; }

        /// <summary>
        /// Gets a value indicating whether the browser requires nonstandard error messages.
        /// </summary>
        bool RequiresHtmlAdaptiveErrorReporting { get; }

        /// <summary>
        /// Gets a value indicating whether the browser requires the first element in the body of a Web page to be an HTML <br> element.
        /// </summary>
        bool RequiresLeadingPageBreak { get; }

        /// <summary>
        /// Gets a value indicating whether the browser does not support HTML <br> elements to format line breaks.
        /// </summary>
        bool RequiresNoBreakInFormatting { get; }

        /// <summary>
        /// Gets a value indicating whether the browser requires pages to contain a size-optimized form of markup language tags.
        /// </summary>
        bool RequiresOutputOptimization { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports phone dialing based on plain text, or whether it requires special markup.
        /// </summary>
        bool RequiresPhoneNumbersAsPlainText { get; }

        /// <summary>
        /// Gets a value indicating whether the browser requires VIEWSTATE values to be specially encoded.
        /// </summary>
        bool RequiresSpecialViewStateEncoding { get; }

        /// <summary>
        /// Gets a value indicating whether the browser requires unique form-action URLs.
        /// </summary>
        bool RequiresUniqueFilePathSuffix { get; }

        /// <summary>
        /// Gets a value indicating whether the browser requires unique name attribute values of multiple HTML <input type="checkbox"> elements.
        /// </summary>
        bool RequiresUniqueHtmlCheckboxNames { get; }

        /// <summary>
        /// Gets a value indicating whether the browser requires unique name attribute values of multiple HTML <input> elements.
        /// </summary>
        bool RequiresUniqueHtmlInputNames { get; }

        /// <summary>
        /// Gets a value indicating whether postback data sent by the browser will be UrlEncoded.
        /// </summary>
        bool RequiresUrlEncodedPostfieldValues { get; }

        /// <summary>
        /// Returns the depth of the display, in bits per pixel.
        /// </summary>
        int ScreenBitDepth { get; }

        /// <summary>
        /// Returns the approximate height of the display, in character lines.
        /// </summary>
        int ScreenCharactersHeight { get; }

        /// <summary>
        /// Returns the approximate width of the display, in characters.
        /// </summary>
        int ScreenCharactersWidth { get; }

        /// <summary>
        /// Returns the approximate height of the display, in pixels.
        /// </summary>
        int ScreenPixelsHeight { get; }

        /// <summary>
        /// Returns the approximate width of the display, in pixels.
        /// </summary>
        int ScreenPixelsWidth { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports the ACCESSKEY attribute of HTML <a> (anchor) and <input> elements.
        /// </summary>
        bool SupportsAccesskeyAttribute { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports the bgcolor attribute of the HTML <body> element.
        /// </summary>
        bool SupportsBodyColor { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports HTML <b> elements to format bold text.
        /// </summary>
        bool SupportsBold { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports the cache-control value for the http-equiv attribute of HTML <meta> elements.
        /// </summary>
        bool SupportsCacheControlMetaTag { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports callback scripts.
        /// </summary>
        bool SupportsCallback { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports Cascading Style Sheets (CSS).
        /// </summary>
        bool SupportsCss { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports the align attribute of HTML <div> elements.
        /// </summary>
        bool SupportsDivAlign { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports the nowrap attribute of HTML <div> elements.
        /// </summary>
        bool SupportsDivNoWrap { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports empty (null) strings in cookie values.
        /// </summary>
        bool SupportsEmptyStringInCookieValue { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports the color attribute of HTML <font> elements.
        /// </summary>
        bool SupportsFontColor { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports the name attribute of HTML <font> elements.
        /// </summary>
        bool SupportsFontName { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports the size attribute of HTML <font> elements.
        /// </summary>
        bool SupportsFontSize { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports using a custom image in place of a standard form Submit button.
        /// </summary>
        bool SupportsImageSubmit { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports i-mode symbols.
        /// </summary>
        bool SupportsIModeSymbols { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports the istyle attribute of HTML <input> elements.
        /// </summary>
        bool SupportsInputIStyle { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports the mode attribute of HTML <input> elements.
        /// </summary>
        bool SupportsInputMode { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports HTML <i> elements to format italic text.
        /// </summary>
        bool SupportsItalic { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports J-Phone multimedia attributes.
        /// </summary>
        bool SupportsJPhoneMultiMediaAttributes { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports J-Phone–specific picture symbols.
        /// </summary>
        bool SupportsJPhoneSymbols { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports a query string in the action attribute value of HTML <form> elements.
        /// </summary>
        bool SupportsQueryStringInFormAction { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports cookies on redirection.
        /// </summary>
        bool SupportsRedirectWithCookie { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports the multiple attribute of HTML <select> elements.
        /// </summary>
        bool SupportsSelectMultiple { get; }

        /// <summary>
        /// Gets a value indicating whether the clearing of a checked HTML <input type=checkbox> element is reflected in postback data.
        /// </summary>
        bool SupportsUncheck { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports receiving XML over HTTP.
        /// </summary>
        bool SupportsXmlHttp { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports HTML <table> elements.
        /// </summary>
        bool Tables { get; }

        /// <summary>
        /// Gets the name and major (integer) version number of the browser.
        /// </summary>
        string Type { get; }

        /// <summary>
        /// Gets a value indicating whether the browser supports Visual Basic Scripting edition (VBScript).
        /// </summary>
        bool VBScript { get; }

        /// <summary>
        /// Gets the full version number (integer and decimal) of the browser as a string.
        /// </summary>
        string Version { get; }

        /// <summary>
        /// Gets the version of the World Wide Web Consortium (W3C) XML Document Object Model (DOM) that the browser supports.
        /// </summary>
        Version W3CDomVersion { get; }

        /// <summary>
        /// Gets a value indicating whether the client is a Win16-based computer.
        /// </summary>
        bool Win16 { get; }

        /// <summary>
        /// Gets a value indicating whether the client is a Win32-based computer.
        /// </summary>
        bool Win32 { get; }

        #endregion

        #region Methods

        /// <summary>
        /// Creates a new instance of the HtmlTextWriter to be used.
        /// </summary>
        /// <param name="w">TextWriter to be created.</param>
        /// <returns>A new instance of the HtmlTextWriter to be used.</returns>
        HtmlTextWriter CreateHtmlTextWriter(TextWriter w);

        /// <summary>
        /// Returns all versions of the .NET Framework common language runtime that are installed on the client.
        /// </summary>
        /// <returns>An array of Version objects.</returns>
        Version[] GetClrVersions();

        /// <summary>
        /// Gets a value indicating whether the client browser is the same as the specified browser.
        /// </summary>
        /// <param name="browserName">The specified browser.</param>
        /// <returns>true if the client browser is the same as the specified browser; otherwise, false. The default is false.</returns>
        bool IsBrowser(string browserName);

        #endregion
    }
}
